import { ErrorHandler, Injectable } from '@angular/core';

@Injectable()
export class GlobalErrorHandlerService implements ErrorHandler {
    constructor() { }

    handleError(error: any) {
        alert('系统发生未知错误，请与系统管理员联系');

        // IMPORTANT: Rethrow the error otherwise it gets swallowed
        throw error;
    }
}